package com.example.demo.study;

import java.util.LinkedList;

public class Study10 {
    public static void main(String[] args) {
        // LinkedList 的增加和删除的操作效率更高，而查找和修改的操作效率较低
        LinkedList<String> list = new LinkedList<>();
        list.add("hell");
        list.add("world");
        list.add("!");
        System.out.println(list);
        System.out.println(list.get(1));
        list.set(1, "Java");
        System.out.println(list);
        list.removeLast();
        System.out.println(list);
        list.removeFirst();
        System.out.println(list);
    }
}
